package com.wangx1n.service;

import com.wangx1n.dao.UserDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author WangXin
 * @date 2020/12/3 22:56
 */
@Component
public class UserService {

    //Autowired类型注入
//    @Autowired

    //Qualifier名称注入
//    @Autowired
//    @Qualifier(value = "userDaoImpl")

    //@Resource
    @Resource(name = "userDaoImpl")
    UserDao userDao;

    //注入普通的
    @Value(value = "namo")
    private String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public UserDao getUserDao() {
        return userDao;
    }

    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }
}
